
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<title>Speed Circle</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<div class="container-fluid">
  <script src="menu.js"></script>
  <div class="content p-3">
    <div class="container-fluid">
      <h2>Speed Circle</h2>
      <hr>
      <canvas id="speed-circle" width="200" height="200"></canvas>

      <h5 class="mt-3">Html</h5>
  <pre><code><!-- Default view dimension 200 x 200 -->
<canvas id="speed-circle" width="200" height="200"></canvas></code></pre>

      <h5>JavaScript</h5>
<pre><code>/* Options */
var options = {
  // Text value and color
  text: {
    value: 'TEST',
    color: '#007bfb'
  },
  // Circle color and rotation speed. Circle 1 to 4 starts from outside towards center.
  circle1: {
    speed: 1,
    color: '#007bfb'
  },
  circle2: {
    speed: -1,
    color: '#007bfb'
  },
  circle3: {
    speed: 1,
    color: '#007bfb'
  },
  circle4: {
    speed: -1,
    color: '#007bfb'
  }
}
/* Constructor */
var speedCircle = new zeu.SpeedCircle('speed-circle', options);

/* Setter */
speedCircle.speed1 = 2;
speedCircle.color1 = '#007bfb';
speedCircle.speed2 = -2;
speedCircle.color2 = '#28a748';
speedCircle.speed3 = 2;
speedCircle.color3 = '#17a2b9';
speedCircle.speed4 = -2;
speedCircle.color4 = '#6c757e';
speedCircle.textValue = 'ZEU';
speedCircle.textColor = '#343a42';</code></pre>

    <h4>More examples</h4>
    <p>
      Change speed and color on the fly.
    </p>
    <canvas id="speed-circle-2" width="200" height="200"></canvas>
    </div>
  </div>
</div>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/highlight.min.js"></script>
<script src="docs.js"></script>
<script src="../dist/zeu.js"></script>
<script type="text/javascript">
/* Options */
var options = {
  // Text value and color
  text: {
    value: 'TEST',
    color: '#007bfb'
  },
  // Circle color and rotation speed. Circle 1 to 4 starts from outside towards center.
  circle1: {
    speed: 1,
    color: '#007bfb'
  },
  circle2: {
    speed: -1,
    color: '#007bfb'
  },
  circle3: {
    speed: 1,
    color: '#007bfb'
  },
  circle4: {
    speed: -1,
    color: '#007bfb'
  }
}
/* Constructor */
var speedCircle = new zeu.SpeedCircle('speed-circle', options);

/* Setter */
speedCircle.speed1 = 2;
speedCircle.color1 = '#007bfb';
speedCircle.speed2 = -2;
speedCircle.color2 = '#28a748';
speedCircle.speed3 = 2;
speedCircle.color3 = '#17a2b9';
speedCircle.speed4 = -2;
speedCircle.color4 = '#6c757e';
speedCircle.textValue = 'ZEU';
speedCircle.textColor = '#343a42';


var speedCircle2 = new zeu.SpeedCircle('speed-circle-2');
    
setInterval(function() {
  speedCircle2.speed1 = getRandomInt(-3, 3);
  speedCircle2.color1 = getRandomColor();
  speedCircle2.speed2 = getRandomInt(-3, 3);
  speedCircle2.color2 = getRandomColor();
  speedCircle2.speed3 = getRandomInt(-3, 3);
  speedCircle2.color3 = getRandomColor();
  speedCircle2.speed4 = getRandomInt(-3, 3);
  speedCircle2.color4 = getRandomColor();
  speedCircle2.textValue = getRandomInt(0, 100);
  speedCircle2.textColor = getRandomColor();
}, 2000);

</script>
</body>
</html>

